@extends('layouts.main')

@section('content')
<div class="container">
    <div class="row">
        <form action="{{ route('users.update', $user->id)}}" method="POST">
            @csrf
            @method('PUT')
            <label for="name">Имя</label>
            <input type="text" value="{{ $user->name ?? old('name')}}" class="form-control" id="name" name="name" placeholder="Укажите имя">
        </div>
        <div class="form-group">
            <label for="name">Фамилия</label>
            <input type="text" value="{{ $user->surname ?? old('surname')}}" class="form-control" id="surname" name="surname" placeholder="Укажите Фамилию">
        </div>
        <div class="form-group">
            <label for="name">Отчество</label>
            <input type="text" value="{{ $user->patronimic ?? old('patronimic')}}" class="form-control" id="patronimic" name="patronimic" placeholder="Укажите Отчество">
        </div>
        <div class="form-group">
            <label for="name">Email</label>
            <input type="text" value="{{ $user->email ?? old('email')}}" class="form-control" id="email" name="email" placeholder="Укажите Email">
        </div>
        <div class="form-group">
            <label for="name">Возраст</label>
            <input type="text" value="{{ $user->age ?? old('age')}}" class="form-control" id="age" name="age" placeholder="Укажите Возраст">
        </div>
        <div class="form-group">
            <select name="gender" id="exampleSelectBorder" class="custom-select form-control">
                <option disabled selected >Пол</option>
                <option {{ $user->genderTitle === 1 || old('gender') === 1 ? 'selected': ''}} value="1">Мужской</option>
                <option {{ $user->genderTitle === 2 || old('gender') === 2 ? 'selected': ''}} value="2">Женский</option>
            </select>
        </div>
                
                <button type="submit" class="btn btn-primary">Изменить</button>
            
        </form>
    </div>
</div>
@endsection